import unittest,time,HTMLTestRunner
from tool.mkdir import mkdir_HTML

mkdir_HTML()
stuie = unittest.defaultTestLoader.discover("./../case",pattern="test*.py")
dir = time.strftime("%Y-%m-%d")
file_path = "./../report/html/"+dir+"/{}.html".format(time.strftime("%Y-%m-%d-%H-%M-%S"))
with open(file_path, "wb") as FB:
    runner = HTMLTestRunner.HTMLTestRunner(stream=FB,
                                           title=u"测试报告",
                                           description="TP商城登录自动化脚本测试报告")

    runner.run(stuie)

